package chixing.day08.work;

public class acctest {
    public static void main(String[] args) {
        // 创建不同类型的账户
        BankAccount savings1 = new MySavingsAccount("SA001", 1000);
        BankAccount checking1 = new MyCheckingAccount("CA001", 800);
        BankAccount savings2 = new MySavingsAccount("SA002", 2000);

        System.out.println("=== 初始账户信息 ===");
        System.out.println(savings1.getAccountInfo());
        System.out.println(checking1.getAccountInfo());
        System.out.println(savings2.getAccountInfo());
        System.out.println("总账户数: " + BankAccount.getTotalAccounts() + "\n");

        // 测试存款和取款
        System.out.println("=== 测试存取款 ===");
        savings1.deposit(500);
        checking1.withdraw(200);
        savings2.withdraw(300);
        System.out.println();

        // 测试每月更新
        System.out.println("=== 测试月度更新 ===");
        savings1.monthlyUpdate();
        checking1.monthlyUpdate();
        savings2.monthlyUpdate();
        System.out.println();

        // 显示更新后的账户信息
        System.out.println("=== 更新后的账户信息 ===");
        System.out.println(savings1.getAccountInfo());
        System.out.println(checking1.getAccountInfo());
        System.out.println(savings2.getAccountInfo());
    }
}
